package io.gitee.twoke.generator.engine.impl.cmd;

import io.gitee.twoke.generator.engine.impl.interceptor.Command;
import io.gitee.twoke.generator.engine.impl.interceptor.CommandContext;

/**
 * 模板不是基于模板组构建的，不需要级联删除
 */
public class DeleteTemplateGroupCmd implements Command<Void> {

    private String groupId;

    public DeleteTemplateGroupCmd(String groupId) {
        this.groupId = groupId;
    }

    @Override
    public Void execute(CommandContext commandContext) {
        commandContext.getTemplateGroupEntityManager().delete(this.groupId);
        commandContext.getTemplateGroupEntityManager().deleteTemplateRelationByGroupId(this.groupId);
        return null;
    }


}